home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-07 | 5.7 KB | 158 lines | [TEXT/MPS ] |
- (*
- File: ConditionalMacros.mod
-
- Contains: Compile time feature switches to achieve platform independent sources.
-
- Version: Technology: Universal Interface Files 2.0
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE ConditionalMacros;
-
- (*
- This file sets up the following compiler independent conditionals*:
-
- GENERATINGPOWERPC - Compiler is generating PowerPC instructions
- GENERATING68K - Compiler is generating 68k family instructions
- GENERATING68881 - Compiler is generating mc68881 floating point instructions
- GENERATINGCFM - Code being generated assumes CFM calling conventions
- CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
-
- SystemSevenFiveOrLater - Compiled code will only be run on a System 7.5 or later Macintosh
- SystemSevenOrLater - Compiled code will only be run on a System 7.0 or later Macintosh
- SystemSixOrLater - Compiled code will only be run on a System 6.0 or later Macintosh
- A developer should set the appropriate flag on the compiler command-
- line or in a file processed before this file. This will allow the
- certain optimizations to be made which can result in smaller, faster
- applications.
-
- CGLUESUPPORTED - Interface library will support "C glue" functions (function names
- are*: all lowercase, use C strings instead of pascal strings, use
- Types.Point* instead of Types.Point).
-
- OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
- (e.g. DisposPtr instead of DisposePtr). The names of system routine
- are now more sensitive to change because CFM binds by name. In the
- past, system routine names were compiled out to just an A-Trap.
- Macros have been added that each map an old name to its new name.
- This allows old routine names to be used in existing source files,
- but the macros only work if OLDROUTINENAMES is true. This support
- will be removed in the near future. Thus, all source code should
- be changed to use the new names! You can set OLDROUTINENAMES to false
- to see if your code has any old names left in it.
-
- OLDROUTINELOCATIONS - "Old" location of Macintosh system calls are used. For example, c2pstr
- has been moved from Strings to TextUtils. It is conditionalized in
- Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
- This allows developers to upgrade to newer interface files without suddenly
- all their code not compiling becuase of "incorrect" includes. But, it
- allows the slow migration of system calls to more understandable file
- locations. OLDROUTINELOCATIONS currently defaults to true, but eventually
- will default to false.
-
- PRAGMA_ALIGN_SUPPORTED - Compiler supports "#pragma align=..." directives. The only compilers that
- can get by without supporting the pragma are old classic 68K compilers
- that will only be used to compile older structs that have 68K alignment
- anyways.
-
- PRAGMA_IMPORT_SUPPORTED - Compiler supports "#pragma import on/off" directives. These directives
- were introduced with the SC compiler which supports CFM 68K. The directive
- is used to tell the compiler which functions will be called through a
- transition vector (instead of a simple PC-relative offset). This allows
- the compiler to generate better code. Since System Software functions are
- implemented as shared libraries and called through transition vectors,
- all System Software functions are declared with "#pragma import on".
-
-
- There are some invariants among the conditionals*:
-
- GENERATINGPOWERPC != GENERATING68K
- GENERATING68881 => GENERATING68K
- GENERATINGPOWERPC => GENERATINGCFM
- GENERATINGPOWERPC => CFMSYSTEMCALLS
- CFMSYSTEMCALLS => GENERATINGCFM
- GENERATINGPOWERPC => SystemSevenOrLater
- SystemSevenFiveOrLater => SystemSevenOrLater
- SystemSevenOrLater => SystemSixOrLater
- PRAGMA_IMPORT_SUPPORTED => CFMSYSTEMCALLS
-
- *)
- (*
-
- Set up GENERATINGPOWERPC and GENERATING68K
-
- *)
- (*$IF UNDEFINED LSPWRP *)
- (*$SET LSPWRP FALSE*)
- (*$END*)
- (*$IF UNDEFINED LSP68K *)
- (*$SET LSP68K NOT LSPWRP*)
- (*$END*)
- (*$IF UNDEFINED GENERATINGPOWERPC *)
- (*$SET GENERATINGPOWERPC LSPWRP*)
- (*$END*)
- (*$IF UNDEFINED GENERATING68K *)
- (*$SET GENERATING68K LSP68K*)
- (*$END*)
- (*
-
- Set up GENERATING68881
-
- *)
- (*$IF GENERATING68K AND OPTION(mc68881) *)
- (*$SET GENERATING68881 TRUE *)
- (*$END*)
- (*$IF UNDEFINED GENERATING68881 *)
- (*$SET GENERATING68881 FALSE*)
- (*$END*)
- (*
-
- Set up GENERATINGCFM and CFMSYSTEMCALLS
-
- *)
- (*$SET GENERATINGCFM GENERATINGPOWERPC*)
- (*$SET CFMSYSTEMCALLS GENERATINGPOWERPC*)
- (*
-
- Set up SystemSevenFiveOrLater, SystemSevenOrLater, and SystemSixOrLater
-
- *)
- (*$IF UNDEFINED SystemSevenFiveOrLater *)
- (*$SET SystemSevenFiveOrLater FALSE*)
- (*$END*)
- (*$IF UNDEFINED SystemSevenOrLater *)
- (*$IF GENERATINGCFM *)
- (*$SET SystemSevenOrLater TRUE*)
- (*$ELSE*)
- (*$SET SystemSevenOrLater SystemSevenFiveOrLater*)
- (*$END*)
- (*$END*)
- (*$IF UNDEFINED SystemSixOrLater *)
- (*$SET SystemSixOrLater SystemSevenOrLater*)
- (*$END*)
- (*
-
- Set up OLDROUTINENAMES and OLDROUTINELOCATIONS
-
- *)
- (*$IF UNDEFINED OLDROUTINENAMES *)
- (*$SET OLDROUTINENAMES TRUE*)
- (*$END*)
- (*$IF UNDEFINED OLDROUTINELOCATIONS *)
- (*$SET OLDROUTINELOCATIONS TRUE*)
- (*$END*)
-
- END ConditionalMacros.
-